perm filename MSGS.76[RUT,LSP] blob
sn#343713 filedate 1978-03-22 generic text, type T, neo UTF8
00100 ∂31-JUL-76 1142 FTP:LEFAIVRE at RUTGERS-10 BUGS IN LISP 1.6 COMPILER
00200 Date: 31 Jul 1976 (Saturday) 1442-Est
00300 From: LEFAIVRE at RUTGERS-10
00400 Subject: BUGS IN LISP 1.6 COMPILER
00500 To: DIFFIE at SU-AI
00600
00700 Whit-
00800
00900 I have no idea who (if anyone) is currently responsible for the LISP
01000 compiler, so I'm sending this to you since your name is on the most
01100 recent manual I've seen. Would you please pass this on to the appropriate
01200 person if you are not he.
01300
01400 I'm making a series of improvements to the UCI LISP system when I can
01500 find the time, including an INTERLISP-like prettyprint package, an "octal
01600 point" (Q) to get rid of the BASE/IBASE problem, a generalized CATCH/THROW
01700 facility, and a number of other (mostly minor) changes and additions. One
01800 change I recently made involved making ERRSETs compile in-line, getting
01900 rid of all of those damn SUBFUNs and their associated special vars. It
02000 works fine, but while fooling around with the compiler I came across a
02100 bug having to do with special vars being bound by nested internal lambdas.
02200 It is typified by code like the following:
02300
02400 (DE BUGGY NIL
02500 ((LAMBDA (L A) (FUNC) L)
02600 L
02700 ((LAMBDA (L) (FUNC) (CAR L)) L)))
02800
02900 In addition to some extra pushes and pops, L is referenced incorrectly
03000 by both lambda exprs. This is evidently an old bug, and also occurs when
03100 compiling the UCI LISP editor function EDIT*.
03200
03300 My question: has any further debugging been done on the compiler in the
03400 last few years (i.e., since the UCI group grabbed the compiler)? In
03500 particular, has this bug been fixed? If so, I would sure like to get
03600 a list of the fixes.
03700
03800 Thanks for your help.
03900
04000 -Rick LeFaivre
04100
00100 ∂09-AUG-76 1147 FTP:LEFAIVRE at RUTGERS-10 Debugged version of COMPLR
00200 Date: 9 Aug 1976 (Monday) 1448-Est
00300 From: LEFAIVRE at RUTGERS-10
00400 Subject: Debugged version of COMPLR
00500 To: DIFFIE at SU-AI
00600
00700 Whit-
00800
00900 I wanted to thank you for the information on the compiler. I took the
01000 liberty of copying your COMPLR.NOT and found it quite helpful. It
01100 confirmed many of the things I had figured out by code reading, and
01200 answered several questions I hadn't figured out. I spent last week
01300 messing around with the code, and as I got more familiar with what's
01400 happening decided to go ahead and fix any problems I found. I copied
01500 COMPLR[LSP,LSP] from SAIL, and as it seemed to be a somewhat more
01600 recent version than the one that comes with UCI LISP, I decided to work
01700 with it (I had already concluded that I needed something like SPLDLST
01800 anyway).
01900
02000 The bug which prompted all this was present in both versions of the
02100 compiler. I discovered that it was somewhat more general than I
02200 had suspected -- it involved having a copy of a special variable
02300 being placed on the PDL without being properly frozen. This was
02400 done by INTERNALLAMBDA, but could also be brought about via P2SETQ,
02500 as with
02600
02700 (DE BUG NIL (FUNC (SETQ L 1) (FUNC1) L))
02800
02900 an (L) gets pushed onto PDL, causing the last L to reference it
03000 instead of the special cell. I fixed this by insuring that nobody
03100 pushes unfrozen values of special variables on the stack. I also
03200 made a number of other changes which fix all of the bugs which I
03300 am aware of (i.e., all those in CTEST and CBUGS), in addition to
03400 some of the correct but inefficient code generation (e.g., useless
03500 pushes and pops). I have one copy of COMPLR from SAIL intact except
03600 for my changes, and another with modifications for UCI LISP which
03700 I will release with my new version. If you would be interested in
03800 getting it, let me know (note, however, that I'm leaving for a
03900 vacation on Nantucket tomorrow and won't be back till August 21).
04000
04100 Although all of the bugs seem to be out of the compiler, there is
04200 still something which is confusing me. The old compiler I have
04300 has a function GUARDLOCS which is called from P2COND and P2PROG,
04400 apparently to force any values waiting to be loaded to get a place
04500 on the PDL before the COND or PROG is entered so that they can
04600 shrink the stack without worrying about them. In the newer compiler
04700 GUARDLOCS has disappeared, with P2COND providing this service only
04800 for those vars which will be set inside the COND. It seems to me
04900 that this is not necessary -- CLEAR1 will make sure that valuable
05000 stuff gets placed on the stack before the COND is entered. If it
05100 is necessary for some reason, why doesn't PROG also have to do the
05200 same thing? I was tempted to just get rid of this all together, but
05300 it was one of the few things I didn't really understand and was thus
05400 hesitant to fool with it. Are you still close enough to the compiler
05500 to fill me in on what's going on here?
05600
05700 -Rick
05800
00100 ∂09-AUG-76 1335 FTP:LEFAIVRE at RUTGERS-10 WHAT HAPPENED TO COPT?
00200 Date: 9 Aug 1976 (Monday) 1636-Est
00300 From: LEFAIVRE at RUTGERS-10
00400 Subject: WHAT HAPPENED TO COPT?
00500 To: DIFFIE at SU-AI
00600
00700 Another quick question. When comparing some LAP code produced by the
00800 new compiler I got from SAIL with that produced by the seemingly older
00900 UCI compiler, I noticed that the new compiler computed a CDR when it
01000 really didn't have to, whereas the old compiler didn't. Upon investigation
01100 I found that the call to COPT in CSTEP had been removed (in fact, COPT is
01200 not used anymore). Do you know the reason for this? Is there any reason
01300 I shouldn't reinstate its use?
01400
01500 -Rick
01600
01700 ∂22-AUG-76 0857 FTP:LEFAIVRE at RUTGERS-10 MORE ON THE LISP COMPILER
01800 Date: 22 Aug 1976 (Sunday) 1155-Est
01900 From: LEFAIVRE at RUTGERS-10
02000 Subject: MORE ON THE LISP COMPILER
02100 To: DIFFIE at SU-AI
02200
02300 Whit-
02400
02500 I'm now back from vacation and trying to get back in the swing and finish
02600 up my fixes to the compiler in the next few days. Did you get my letter
02700 of August 9? I'm still unclear as to the removal of GUARDLOCS in the version
02800 of COMPLR in [LSP,LSP].
02900
03000 I also noticed that the new compiler recomputed a CAR at a time when it had
03100 it sitting in a register -- the old compiler knew that it was already there.
03200 I traced this down to the fact that the call to COPT in CSTEP was removed for
03300 some reason (in fact, COPT is not even used in the new version). Do you
03400 know why this was done? Would some obscure bug reoccur if I reinserted it?
03500
03600 -Rick
03700